<template>
  <div>
    <div class="mp-group">
    <div class="title">
      <img class="title-ico" src="@/assets/images/small01.png"/>
      热门推荐
    </div>
    <ul>
      <router-link
        class="item"
        v-for="item of list['list01']"
        :key="item.id"
        :to="'/detail/'+ item.id"
      >
        <img class="item-img" :src="item.imgUrl"/>
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <div class="item-score">
            <i class="iconfont ico-star">&#xe64c;</i>
            <i class="iconfont ico-star">&#xe64c;</i>
            <i class="iconfont ico-star">&#xe64c;</i>
            <i class="iconfont ico-star">&#xe64c;</i>
            <i class="iconfont ico-star">&#xe64c;</i>
            <button class="item-button">查看详细</button>
          </div>
        </div>
      </router-link>
    </ul>
    </div>
    <div class="mp-group">
      <div class="title">
        <img class="title-ico" src="@/assets/images/small02.png"/>
        猜你喜欢
      </div>
      <ul>
        <router-link
          class="item"
          v-for="item of list['list02']"
          :key="item.id"
          :to="'/detail/'+ item.id"
        >
          <img class="item-img" :src="item.imgUrl"/>
          <div class="item-info">
            <p class="item-title">{{item.title}}</p>
            <p class="item-desc">{{item.desc}}</p>
            <div class="item-score">
              <i class="iconfont ico-star">&#xe64c;</i>
              <i class="iconfont ico-star">&#xe64c;</i>
              <i class="iconfont ico-star">&#xe64c;</i>
              <i class="iconfont ico-star">&#xe64c;</i>
              <i class="iconfont ico-star">&#xe64c;</i>
              <button class="item-button">查看详细</button>
            </div>
          </div>
        </router-link>
      </ul>
    </div>
    <div>
      <a class="mp-like-more" href="javascript:;">查看更多产品</a>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Object
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .title
    line-height: .8rem
    background: #eee
    text-indent: .2rem
    .title-ico
      width: .33rem
      margin-top:-.04rem
  .item
    overflow: hidden
    display: flex
    height: 2rem
    padding: .22rem
    border-bottom: solid #eee .02rem
    .item-img
      width:2rem
      height:2rem
    .item-info
      flex: 1
      padding: .1rem
      padding-left: 0.2rem
      min-width: 0
      .item-title
        line-height: .54rem
        font-size: .32rem
        ellipse()
      .item-desc
        line-height: .4rem
        color: #999
        -webkit-line-clamp:2;
        display:-webkit-box;
        -webkit-box-orient:vertical;
        ellipse()
        white-space:normal;
      .item-score
        height: .54rem
        line-height: .54rem
        .ico-star
          font-size: .25rem
          color: #FFB436
        .item-button
          float: right
          background: #ff9300
          margin-top: .1rem
          padding: 0 .2rem
          border-radius: .06rem
          color: #fff
          line-height: .44rem
          font-size: .26rem
  .mp-like-more
    display: block
    padding: .2rem 0
    color: #00afc7
    font-size: .28rem
    line-height: .4rem
    text-align: center
</style>
